{% extends 'base_user.html' %}
{% block con %}
    <div class="main_con clearfix">
        <div class="left_menu_con clearfix">
            <h3>用户中心</h3>
            <ul>
                <li><a href="{% url 'user:info' %}">· 个人信息</a></li>
                <li><a href="{% url 'user:order' %}" class="active">· 全部订单</a></li>
                <li><a href="{% url 'user:site' %}">· 收货地址</a></li>
            </ul>
        </div>
        <div class="right_content clearfix">
            <h3 class="common_title2">全部订单</h3>
            {% for foo in page %}
                <ul class="order_list_th w978 clearfix">
                    <li class="col01">{{ foo.odate }}</li>
                    <li class="col02">订单号：{{ foo.oid }}</li>
                    <li class="col02 stress">未支付</li>
                </ul>

                <table class="order_list_table w980">
                    <tbody>
                    <tr>
                        <td width="55%">
                            {% for fo in foo.orderdetailinfo_set.all %}
                                <ul class="order_goods_list clearfix">
                                    <li class="col01"><img src="/media/{{ fo.goods.gpic }}"></li>
                                    <li class="col02">{{ fo.goods.gtitle }}<em>{{ fo.goods.gprice }}元/{{ fo.goods.gunit }}</em>
                                    </li>
                                    <li class="col03">{{ fo.count }}</li>
                                    <li class="col04">
                                        {% widthratio fo.count 1 fo.goods.gprice as price %}{{ price|floatformat:2 }}元
                                    </li>
                                </ul>
                            {% endfor %}
                        </td>
                        <td width="15%">{{ foo.ototal }}元</td>
                        <td width="15%">待付款</td>
                        <td width="15%"><a href="#" class="oper_btn">去付款</a></td>
                    </tr>
                    </tbody>
                </table>
            {% endfor %}


            <div class="pagenation">
                {% if page.has_previous %}
                    <a href="{% url 'user:order' %}?page={{ page.previous_page_number }}">上一页</a>
                {% endif %}
                {% for item in paginator.page_range %}
                    {% if item == page.number %}
                        <a href="#" class="active">{{ item }}</a>
                    {% else %}
                        <a href="{% url 'user:order' %}?page={{ item }}">{{ item }}</a>
                    {% endif %}
                {% endfor %}
                {% if page.has_next %}
                    <a href="{% url 'user:order' %}?page={{ page.next_page_number }}">下一页</a>
                {% endif %}
            </div>
        </div>
    </div>
{% endblock %}

